﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RestSharp;

namespace Infrastructure.RestSharpWrap
{
    public class RestClientExt : IRestClientExt
    {
        private readonly IRestClient _restClient;

        public RestClientExt(
            IRestClient restClient
            )
        {
            _restClient = restClient ?? throw new ArgumentNullException(nameof(restClient));
        }

        public Task<T> PostAsync<T>(IRestRequest request, CancellationToken cancellationToken = default)
        {
            return _restClient.PostAsync<T>(request, cancellationToken);
        }
    }
}
